package com.zhichat.infrastructure.Enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName: ApplyStatusEnum
 * @Description: 申请信息状态enum
 * @Author: 团长九哥 https://space.bilibili.com/602197686
 * @CreateDate: 2024/11/16 21:08
 */
@Getter
@AllArgsConstructor
public enum ApplyStatusEnum {
    APPLYING(1, "待处理"),
    APPROVED(2, "已同意"),
    REJECTED(3, "已拒绝"),
    BLACKED(4, "已拉黑"),
    EXPIRED(5, "已失效");
    private final Integer code;
    private final String desc;

    public static ApplyStatusEnum getByCode(Integer code) {
        for (ApplyStatusEnum status : ApplyStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}
